package org.adream.account.dao;

import org.adream.account.entity.UserRoleLinkEntity;
import org.apache.ibatis.annotations.Param;

@BaseMybatisDao
public interface UserRoleLinkDao {

	int replaceUserRoleById(@Param("uid") String uid, @Param("rleId") String rleId);
	
	void deleteUserRole(@Param("uid") String uid,@Param("rleId") String rleId);
	
	void deleteUserRoleByUid(@Param("uid") String uid);
	
	//根据uid和是否为认证角色删除user-role
	void deleteUserRoleByUidAndVerify(@Param("uid") String uid, @Param("verify") Integer verify);
	
	void deleteUserRoleByRleId(@Param("rleId") String rleId);
	
	UserRoleLinkEntity queryUserRoleById(@Param("uid") String uid,@Param("rleId") String rleId);
	
	UserRoleLinkEntity queryUidsByRleIdAndDr(@Param("rleId") String rleId,@Param("dr") Integer dr);
	
	//根据uid和dr查询用户角色
	UserRoleLinkEntity queryRolesByUidAndDr(@Param("uid") String uid, @Param("dr") Integer dr);
	
	//根据uid和dr和是否为认证角色查询用户认证的角色
	UserRoleLinkEntity queryRolesByUidAndDrAndVerify(@Param("uid") String uid, @Param("dr") Integer dr, @Param("verify") Integer verify);
}